import {Component, Input, OnInit} from '@angular/core';
import {Menu} from '../../entity/menu';
import {MenuService} from '../../service/menu.service';
import {UserService} from '../../service/user.service';

@Component({
    selector: 'app-left-nav-api-item',
    templateUrl: './left-nav-api-item.component.html',
    styleUrls: ['./left-nav-api-item.component.css']
})
export class LeftNavApiItemComponent implements OnInit {
    @Input()
    menuList: Menu[];

    constructor(private menuService: MenuService,
                private userService: UserService) {
    }

    ngOnInit() {
    }

    public expanding(menu: Menu): void {
        this.menuService.expandMenu(menu, this.userService.getUser());
    }
}
